package cn.centec.service;

import cn.centec.bid.util.Centec6BidRequestApiUtil;
import cn.centec.entity.StandardContractCreateParamImpl;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.ArrayList;

/**
 * 请求测试
 *
 * @author 延晓磊
 * @since 2023年02月09日
 */
@Component
public class RequestTestService {

    @Resource
    private Centec6BidRequestApiUtil centec6BidRequestApiUtil;

    /**
     * 创建合同
     */
    public void createContract(){
        // 扩展参数的主类
        StandardContractCreateParamImpl param = new StandardContractCreateParamImpl();
        param.setContent("标准参数");
        param.setParam("扩展参数");
        // 扩展参数的内部类
        StandardContractCreateParamImpl.MaterialImpl material = new StandardContractCreateParamImpl.MaterialImpl();
        material.setName("标准参数");
        material.setParam("扩展参数");
        // 以重写的类作为请求参数
        param.setMaterialList(new ArrayList<>());
        param.getMaterialList().add(material);
        centec6BidRequestApiUtil.createContract(param);
    }


}
